package cn.cvs.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping(value = "/hello")
public class HelloController  {
    @RequestMapping(value = "/hello1")
    public String hello1() throws Exception{
        System.out.println("hello");
        return "hello1";
    }
    @RequestMapping(value = "/show")
    public String show(Model model,@RequestParam String realName) throws Exception{
        model.addAttribute("realName",realName);
        model.addAttribute(realName);
        return "show";
    }

//    @Override
//    protected ModelAndView handleRequestInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
//        return new ModelAndView("hello");
//    }
}
